/// <summary>
/// 单例模式基类
/// </summary>
/// <typeparam name="T"></typeparam>
public class Singleton<T> where T : new()
{
    private static T instance;
    public static T GetInstance()
    {
        if (instance == null)
            instance = new T();
        return instance;
    }
}

// //使用
// public class GameManager : Singleton<GameManager>
// {
// }